<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../../../resources/js-test.js"></script>
<script src="../resources/common.js"></script>
<script src="../resources/picker-common.js"></script>
</head>
<body>
<select id="menu">
  <option selected>いろはにほへと</option>
</select>
<script>
var menuElement = document.getElementById('menu');
var picker;

function openPickerErrorCallback() {
    testFailed('picker didn\'t open')
    finishJSTest();
}
openPicker(menu, test1, openPickerErrorCallback);

function test1() {
    picker = internals.pagePopupWindow.global.picker;

    menuElement.style.color = 'rgb(123, 0, 0)';

    picker.on("didUpdate", function () {
        setTimeout(function() {
            shouldBeEqualToString('picker._selectElement.options[0].label', 'いろはにほへと');
            finishJSTest();
        }, 0);
    });
}
</script>
</body>
</html>
